package fr.masterglr.website.googlr.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@SuppressWarnings("unused")
@Entity
@Table(name="Result")

public class Result implements Serializable {
	/**
	 * Generated Serial Version UID
	 */
	private static final long serialVersionUID = 3551503228056369434L;

	@Id
	@Column(name = "ID_RESULT", nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	@Column(name = "URL", nullable = false)
	private String url;
	
	@Column(name = "Title", nullable = false)
	private String title;
	
	@Column(name = "SUMMARY", nullable = false)
	private String summary;
	
	@ManyToOne
	@JoinColumn(name = "SEARCH_ID")
	private Search search;
	
	// constructeurs
	public Result() {
	}



	public Result(String url, String title, String summary, Search search) {
		super();
		this.url = url;
		this.title = title;
		this.summary = summary;
		this.search = search;
	}


	/**
	 * @return Returns the id.
	 */
	public Integer getId() {
		return id;
	}


	/**
	 * @param id The id to set.
	 */
	public void setId(Integer id) {
		this.id = id;
	}


	/**
	 * @return Returns the search.
	 */
	public Search getSearch() {
		return search;
	}


	/**
	 * @param search The search to set.
	 */
	public void setSearch(Search search) {
		this.search = search;
	}


	/**
	 * @return Returns the summary.
	 */
	public String getSummary() {
		return summary;
	}


	/**
	 * @param summary The summary to set.
	 */
	public void setSummary(String summary) {
		this.summary = summary;
	}


	/**
	 * @return Returns the title.
	 */
	public String getTitle() {
		return title;
	}


	/**
	 * @param title The title to set.
	 */
	public void setTitle(String title) {
		this.title = title;
	}


	/**
	 * @return Returns the url.
	 */
	public String getUrl() {
		return url;
	}


	/**
	 * @param url The url to set.
	 */
	public void setUrl(String url) {
		this.url = url;
	}

}
